package com.hzcx.app.simplechat.ui.friend.presenter;

import android.content.Context;

import com.hzcx.app.simplechat.api.BaseDialogObserver;
import com.hzcx.app.simplechat.api.BaseObserver;
import com.hzcx.app.simplechat.base.BaseEmptyBean;
import com.hzcx.app.simplechat.base.BasePresenter;
import com.hzcx.app.simplechat.model.FriendModel;
import com.hzcx.app.simplechat.ui.friend.bean.FriendBean;
import com.hzcx.app.simplechat.ui.friend.bean.FriendLableListBean;
import com.hzcx.app.simplechat.ui.friend.contract.FriendContract;
import com.hzcx.app.simplechat.ui.friend.contract.FriendLableListContract;
import com.hzcx.app.simplechat.ui.main.bean.FriendRequestCountBean;

import java.util.List;

public class FriendLableListPresenter extends BasePresenter<FriendLableListContract.View> implements FriendLableListContract.Presenter {


    /**
     * 获取标签列表
     *
     * @param context
     */
    @Override
    public void getFriendLableList(Context context) {
        FriendModel.getFriendLableList(context, new BaseDialogObserver<List<FriendLableListBean>>(context) {
            @Override
            protected void onSuccess(List<FriendLableListBean> data) {
                mView.lableResult(data);
            }
        });
    }

    /**
     *  删除标签
     * @param context
     * @param id
     * @param pos
     */
    @Override
    public void deleteFriendLable(Context context, int id, int pos) {
        FriendModel.deleteFriendLable(context, id, new BaseDialogObserver<BaseEmptyBean>(context) {
            @Override
            protected void onSuccess(BaseEmptyBean data) {
                mView.deleteSuccess(pos);
            }
        });
    }
}
